package cn.cp.baseframe.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping("/consumerTest")
public class ConsumerTestController {

    private final static String PROVIDER_URL = "http://provider-consul";

    @Resource
    private RestTemplate restTemplate;

    @GetMapping
    public String consumerTest(){
        return restTemplate.getForObject(PROVIDER_URL+"/test",String.class);
    }
}
